package com.falm.picturebackend.entity.DO;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;

/**
 * 文件关系表
 * @TableName file_relations
 */
@TableName(value ="file_relations")
public class FileRelationsDO {
    /**
     * 自增内部主键
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 源文件UUID
     */
    private String sourceFileUuid;

    /**
     * 目标文件UUID
     */
    private String targetFileUuid;

    /**
     * 关系类型
     */
    private Object relationType;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 自增内部主键
     */
    public Long getId() {
        return id;
    }

    /**
     * 自增内部主键
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * 源文件UUID
     */
    public String getSourceFileUuid() {
        return sourceFileUuid;
    }

    /**
     * 源文件UUID
     */
    public void setSourceFileUuid(String sourceFileUuid) {
        this.sourceFileUuid = sourceFileUuid;
    }

    /**
     * 目标文件UUID
     */
    public String getTargetFileUuid() {
        return targetFileUuid;
    }

    /**
     * 目标文件UUID
     */
    public void setTargetFileUuid(String targetFileUuid) {
        this.targetFileUuid = targetFileUuid;
    }

    /**
     * 关系类型
     */
    public Object getRelationType() {
        return relationType;
    }

    /**
     * 关系类型
     */
    public void setRelationType(Object relationType) {
        this.relationType = relationType;
    }

    /**
     * 创建时间
     */
    public Date getCreateTime() {
        return createTime;
    }

    /**
     * 创建时间
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        FileRelationsDO other = (FileRelationsDO) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getSourceFileUuid() == null ? other.getSourceFileUuid() == null : this.getSourceFileUuid().equals(other.getSourceFileUuid()))
            && (this.getTargetFileUuid() == null ? other.getTargetFileUuid() == null : this.getTargetFileUuid().equals(other.getTargetFileUuid()))
            && (this.getRelationType() == null ? other.getRelationType() == null : this.getRelationType().equals(other.getRelationType()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getSourceFileUuid() == null) ? 0 : getSourceFileUuid().hashCode());
        result = prime * result + ((getTargetFileUuid() == null) ? 0 : getTargetFileUuid().hashCode());
        result = prime * result + ((getRelationType() == null) ? 0 : getRelationType().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", sourceFileUuid=").append(sourceFileUuid);
        sb.append(", targetFileUuid=").append(targetFileUuid);
        sb.append(", relationType=").append(relationType);
        sb.append(", createTime=").append(createTime);
        sb.append("]");
        return sb.toString();
    }
}